﻿//-----------------------------------------------------------------------
// <copyright file="MainPage.xaml.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Silverlight.Studio
{
    using System;

    using System.Diagnostics;

    using System.Windows;
    using System.Windows.Controls;

    using System.Security;
    using System.Security.Principal;

    using System.Threading;

    using CodePlex.Diagnostics.Silverlight;
    using CodePlex.Diagnostics.Silverlight.Contracts;

    /// <summary>
    /// Encapsulates the CodePlex.Diagnostics Silverlight application main page.
    /// </summary>
    public sealed partial class MainPage : UserControl
    {
        #region public MainPage()

        /// <summary>
        /// Initializes a new instance of the <see cref="T:MainPage"/> class.
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            string message = "Greeting's from Silverlight 3.0";

            message.Log(LoggingPriority.Low, LoggingType.Information);

            Debug.WriteLine(Thread.CurrentThread.ManagedThreadId);

            try
            {
                for (int index = 0; index < 10; index++)
                {
                    index /= index;
                }
            }
            catch (DivideByZeroException ex)
            {
                ex.Publish();
            }
        }

        #endregion
    }
}
